capture log close
log using "RRP-APSR-ReplicationCode-Supp-2017-04-04.log", replace

clear
clear matrix
set more off



****************************************************************************************
*
* Reese, Ruby and Pape 
*
* "Days of Action or Restraint? How the Islamic Calendar Impacts Violence"
*
* Online Supplementary Appendix Replication Code
* 
* April 4, 2017
*
****************************************************************************************



****************************************************************************************
* Supplementary Table 1
****************************************************************************************


**Afghanistan Models

use RRP-APSR-RepData-2017-04-04-AFG.dta, clear

*Model 1
nbreg ctwits drelph drelnph dsecph if gyear>=2004 & gyear<=2011, robust nolog

*Model 2
nbreg ctgtd drelph drelnph dsecph if gyear>=2004 & gyear<=2014, robust nolog

*Model 3
nbreg ctsigact drelph drelnph dsecph if gyear>=2008 & gyear<=2014, robust nolog


**Iraq Models

use RRP-APSR-RepData-2017-04-04-IRQ.dta, clear

*Model 4
nbreg ctwits drelph drelnph dsecph if gyear>=2004 & gyear<=2011, robust nolog

*Model 5
nbreg ctgtd drelph drelnph dsecph if gyear>=2004 & gyear<=2014, robust nolog

*Model 6
nbreg ctibc drelph drelnph dsecph if (gyear>=2004 & gyear<=2008) | (gyear==2009 & gnummnth<=6), robust nolog


**Pakistan Models

use RRP-APSR-RepData-2017-04-04-PAK.dta, clear

*Model 7
nbreg ctwits drelph drelnph dsecph if gyear>=2004 & gyear<=2011, robust nolog

*Model 8
nbreg ctgtd drelph drelnph dsecph if gyear>=2004 & gyear<=2014, robust nolog

*Model 9
nbreg ctpips drelph drelnph dsecph if gyear>=2004 & gyear<=2014, robust nolog



****************************************************************************************
* Supplementary Table 2
****************************************************************************************


**Afghanistan Models

use RRP-APSR-RepData-2017-04-04-AFG.dta, clear

*Model 1
logit dwits drelph drelnph dsecph afgelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg drcid2-drcid5 d2005-d2011 dayid witspdys witspdys2 witspdys3 if gyear>=2004 & gyear<=2011, robust nolog

*Model 2
logit dgtd drelph drelnph dsecph afgelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg drcid2-drcid5 d2005-d2014 dayid gtdpdys gtdpdys2 gtdpdys3 if gyear>=2004 & gyear<=2014, robust nolog

*Model 3
logit dsigact drelph drelnph dsecph afgelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg drcid2-drcid5 d2009-d2014 dayid sigactpdys sigactpdys2 sigactpdys3 if gyear>=2008 & gyear<=2014, robust nolog


**Iraq Models

use RRP-APSR-RepData-2017-04-04-IRQ.dta, clear

*Model 4
logit dwits drelph drelnph dsecph irqelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg dprovid2-dprovid18 d2005-d2011 dayid witspdys witspdys2 witspdys3 if gyear>=2004 & gyear<=2011, robust nolog

*Model 5
logit dgtd drelph drelnph dsecph irqelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg dprovid2-dprovid18 d2005-d2014 dayid gtdpdys gtdpdys2 gtdpdys3 if gyear>=2004 & gyear<=2014, robust nolog

*Model 6
logit dibc drelph drelnph dsecph irqelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg dprovid2-dprovid18 d2005-d2009 dayid ibcpdys ibcpdys2 ibcpdys3 if (gyear>=2004 & gyear<=2008) | (gyear==2009 & gnummnth<=6), robust nolog


**Pakistan Models

use RRP-APSR-RepData-2017-04-04-PAK.dta, clear

*Model 7
logit dwits drelph drelnph dsecph pakelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg dproid2-dproid8 d2005-d2011 dayid witspdys witspdys2 witspdys3 if gyear>=2004 & gyear<=2011, robust nolog

*Model 8
logit dgtd drelph drelnph dsecph pakelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg dproid2-dproid8 d2005-d2014 dayid gtdpdys gtdpdys2 gtdpdys3 if gyear>=2004 & gyear<=2014, robust nolog

*Model 9
logit dpips drelph drelnph dsecph pakelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg dproid2-dproid8 d2005-d2014 dayid pipspdys pipspdys2 pipspdys3 if gyear>=2004 & gyear<=2014, robust nolog



****************************************************************************************
* Supplementary Table 3
****************************************************************************************


**Afghanistan Models

use RRP-APSR-RepData-2017-04-04-AFG.dta, clear

*Model 1
relogit dwits drelph drelnph dsecph afgelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg drcid2-drcid5 d2005-d2011 dayid witspdys witspdys2 witspdys3 if gyear>=2004 & gyear<=2011

*Model 2
relogit dgtd drelph drelnph dsecph afgelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg drcid2-drcid5 d2005-d2014 dayid gtdpdys gtdpdys2 gtdpdys3 if gyear>=2004 & gyear<=2014

*Model 3
relogit dsigact drelph drelnph dsecph afgelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg drcid2 drcid3 drcid5 d2009-d2014 dayid sigactpdys sigactpdys2 sigactpdys3 if drcid4==0 & gyear>=2008 & gyear<=2014


**Iraq Models

use RRP-APSR-RepData-2017-04-04-IRQ.dta, clear

*Model 4
relogit dwits drelph drelnph dsecph irqelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg dprovid2-dprovid18 d2005-d2011 dayid witspdys witspdys2 witspdys3 if gyear>=2004 & gyear<=2011

*Model 5
relogit dgtd drelph drelnph dsecph irqelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg dprovid2-dprovid18 d2005-d2014 dayid gtdpdys gtdpdys2 gtdpdys3 if gyear>=2004 & gyear<=2014

*Model 6
relogit dibc drelph drelnph dsecph irqelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg dprovid2-dprovid18 d2005-d2009 dayid ibcpdys ibcpdys2 ibcpdys3 if (gyear>=2004 & gyear<=2008) | (gyear==2009 & gnummnth<=6)


**Pakistan Models

use RRP-APSR-RepData-2017-04-04-PAK.dta, clear

*Model 7
relogit dwits drelph drelnph dsecph pakelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg dproid2-dproid8 d2005-d2011 dayid witspdys witspdys2 witspdys3 if gyear>=2004 & gyear<=2011

*Model 8
relogit dgtd drelph drelnph dsecph pakelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg dproid2-dproid8 d2005-d2014 dayid gtdpdys gtdpdys2 gtdpdys3 if gyear>=2004 & gyear<=2014

*Model 9
relogit dpips drelph drelnph dsecph pakelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg dproid2-dproid8 d2005-d2014 dayid pipspdys pipspdys2 pipspdys3 if gyear>=2004 & gyear<=2014



****************************************************************************************
* Supplementary Table 4
****************************************************************************************


**Afghanistan Models

use RRP-APSR-RepData-2017-04-04-AFG.dta, clear

*Model 1
nbreg ctwits ddowk6 dhm01 dhm07 dhm09 dhm11 dhm12 dahny1 ddoas1 dmanu1 dmanh1 disam1 dlyab1 dfdor1 dlaqh1 dlaqu1 deidf3 ddoar1 deida4 dlibd1 danyd1 dvicd1 dlabd1 dindd1 afgelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg drcid2-drcid5 d2005-d2011 dayid ctwitslg if gyear>=2004 & gyear<=2011, robust nolog

*Model 2
nbreg ctgtd ddowk6 dhm01 dhm07 dhm09 dhm11 dhm12 dahny1 ddoas1 dmanu1 dmanh1 disam1 dlyab1 dfdor1 dlaqh1 dlaqu1 deidf3 ddoar1 deida4 dlibd1 danyd1 dvicd1 dlabd1 dindd1 afgelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg drcid2-drcid5 d2005-d2014 dayid ctgtdlg if gyear>=2004 & gyear<=2014, robust nolog

*Model 3
nbreg ctsigact ddowk6 dhm01 dhm07 dhm09 dhm11 dhm12 dahny1 ddoas1 dmanu1 dmanh1 disam1 dlyab1 dfdor1 dlaqh1 dlaqu1 deidf3 ddoar1 deida4 dlibd1 danyd1 dvicd1 dlabd1 dindd1 afgelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg drcid2-drcid5 d2009-d2014 dayid ctsigactlg if gyear>=2008 & gyear<=2014, robust nolog


**Iraq Models

use RRP-APSR-RepData-2017-04-04-IRQ.dta, clear

*Model 4
nbreg ctwits ddowk6 dhm01 dhm07 dhm09 dhm11 dhm12 dahny1 ddoas1 dmanu1 dmanh1 disam1 dlyab1 dfdor1 dlaqh1 dlaqu1 deidf3 ddoar1 deida4 ddowk5 dnyrd1 darmd1 dlabd1 drepd1 dindd1 irqelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg dprovid2-dprovid18 d2005-d2011 dayid ctwitslg if gyear>=2004 & gyear<=2011, robust nolog

*Model 5
nbreg ctgtd ddowk6 dhm01 dhm07 dhm09 dhm11 dhm12 dahny1 ddoas1 dmanu1 dmanh1 disam1 dlyab1 dfdor1 dlaqh1 dlaqu1 deidf3 ddoar1 deida4 ddowk5 dnyrd1 darmd1 dlabd1 drepd1 dindd1 irqelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg dprovid2-dprovid18 d2005-d2014 dayid ctgtdlg if gyear>=2004 & gyear<=2014, robust nolog

*Model 6
nbreg ctibc ddowk6 dhm01 dhm07 dhm09 dhm11 dhm12 dahny1 ddoas1 dmanu1 dmanh1 disam1 dlyab1 dfdor1 dlaqh1 dlaqu1 deidf3 ddoar1 deida4 ddowk5 dnyrd1 darmd1 dlabd1 drepd1 dindd1 irqelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg dprovid2-dprovid18 d2005-d2009 dayid ctibclg if (gyear>=2004 & gyear<=2008) | (gyear==2009 & gnummnth<=6), robust nolog


**Pakistan Models

use RRP-APSR-RepData-2017-04-04-PAK.dta, clear

*Model 7
nbreg ctwits ddowk6 dhm01 dhm07 dhm09 dhm11 dhm12 dahny1 ddoas1 dmanu1 dmanh1 disam1 dlyab1 dfdor1 dlaqh1 dlaqu1 deidf3 ddoar1 deida4 ddowk1 dkhsd1 dpakd1 dlabd1 dindd1 daidd1 dqabd1 pakelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg dproid2-dproid8 d2005-d2011 dayid ctwitslg if gyear>=2004 & gyear<=2011, robust nolog

*Model 8
nbreg ctgtd ddowk6 dhm01 dhm07 dhm09 dhm11 dhm12 dahny1 ddoas1 dmanu1 dmanh1 disam1 dlyab1 dfdor1 dlaqh1 dlaqu1 deidf3 ddoar1 deida4 ddowk1 dkhsd1 dpakd1 dlabd1 dindd1 daidd1 dqabd1 pakelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg dproid2-dproid8 d2005-d2014 dayid ctgtdlg if gyear>=2004 & gyear<=2014, robust nolog

*Model 9
nbreg ctpips ddowk6 dhm01 dhm07 dhm09 dhm11 dhm12 dahny1 ddoas1 dmanu1 dmanh1 disam1 dlyab1 dfdor1 dlaqh1 dlaqu1 deidf3 ddoar1 deida4 ddowk1 dkhsd1 dpakd1 dlabd1 dindd1 daidd1 dqabd1 pakelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinactlg dproid2-dproid8 d2005-d2014 dayid ctpipslg if gyear>=2004 & gyear<=2014, robust nolog



clear matrix
log close
